home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define BoxSize 13
- #define CorrectTime 2
-
- void DiagonalWipe(GrafPtr);
-
- /* If you make a long enough region starting at the bottomright corner and
- making a strip up and right of <BoxSize> width, all you have to do is move
- the region left until the entire screen is filled. Dave thinks ideas like
- this should be taken out and shot, but it works. */
-
- void DiagonalWipe(GrafPtr sourceGrafPtr)
- {
- int counter,maxmax;
- Rect source;
- RgnHandle archie;
-
- maxmax=MAIN_WINDOW_WIDTH+BoxSize;
- archie=NewRgn();
- OpenRgn();
- MoveTo(MAIN_WINDOW_WIDTH+BoxSize,MAIN_WINDOW_HEIGHT+BoxSize);
- Line(0,BoxSize);
- Line(-maxmax,maxmax);
- Line(-BoxSize,0);
- Line(maxmax,-maxmax);
- CloseRgn(archie);
- source.top=source.left=0;
- source.bottom=MAIN_WINDOW_HEIGHT;
- source.right=MAIN_WINDOW_WIDTH;
-
- /* the only tricky part to this code is the starting param for counter */
- for (counter=2+(MAIN_WINDOW_WIDTH+MAIN_WINDOW_HEIGHT)/BoxSize; counter>=0; counter--)
- {
- StartTiming();
- OffsetRgn(archie,0,-BoxSize);
- CopyBits(&(sourceGrafPtr->portBits),&(gMainWindow->portBits),&source,&source,
- 0,archie);
- TimeCorrection(CorrectTime);
- }
- DisposeRgn(archie);
- }
-